clear
clear matrix
clear mata
set more off
set maxvar 32000


cd "/Users/alee87/Dropbox/Agra/"
set scheme plotplainblind

use  "./Analysis/workingdata.dta", clear



sutex upper_vill brahmin_vill jat_vill chamar_vill land_1929_single    logpop_1891   agra_dist  absenteeprop totalarea primaryschool middleschool highschool electricity puccaroad postoffice , label
set matsize 8000

gen sc_sample=.
replace sc_sample=1 if current_sc!=.
egen sc_sample2=total(sc_sample), by (VillageCode)
tab sc_sample2
bysort year: sum current_sc if  sc_sample2==5
drop sc_sample*


drop if latitude==.
	
*moran's i
*preserve
*set matsize 2000
*keepi.subdistrictcode if year==2011
*spatwmat, name(weights) xcoord(longitude) ycoord(latitude) band(0 2)
*spatgsa primary, weights(weights) moran

*restore
*********************Models**************************



****survival models (Table A10 and Table A20)

stset year, id( VillageCode) failure(primaryschool ==1) origin(year==1905) 
stdes
stsum
xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_primary)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES) ctitle("Primary Sch.") label replace   nocons onecol 
xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_primary)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES) ctitle("Primary School")  label replace   nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("Primary Sch.") label replace   nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_primary)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("Primary Sch.") label replace   nocons onecol 


stset year, id( VillageCode) failure(postoffice ==1) origin(year==1905) 
stdes
stsum

xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_post)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES)  label append tex(frag) ctitle("Post Office")   nocons onecol 
xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_post)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES) ctitle("Post Office")  label append tex(frag)    nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("Post Office")  label append tex(frag)    nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_post)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("Post Office")  label append tex(frag)   nocons onecol 


stset year, id( VillageCode) failure(middleschool ==1) origin(year==1905) 
stdes
stsum

xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_middle)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES) ctitle("Middle Sch.") label append tex(frag)    nocons onecol 

xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_middle)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES)  ctitle("Middle School") label append tex(frag)    nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("Middle School")  label append tex(frag)    nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_middle)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("Middle School")  label append tex(frag)   nocons onecol 


stset year, id( VillageCode) failure(highschool ==1) origin(year==1905) 
stdes
stsum
xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_highschool)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES) ctitle("High Sch.")  label append tex(frag)    nocons onecol 
xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_highschool)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES) ctitle("High Sch.")  label append tex(frag)    nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("High School")  label append tex(frag)    nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_high)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("High School")  label append tex(frag)   nocons onecol 


stset year, id( VillageCode) failure(pucca ==1) origin(year==1971) 
stdes
stsum
xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_pucca)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES) ctitle("Pucca Road")  label append tex(frag)    nocons onecol 
xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_pucca)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES)  ctitle("Pucca Road")  label append tex(frag)    nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("Pucca Road")  label append tex(frag)    nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_pucca)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("Pucca Road")  label append tex(frag)   nocons onecol 


stset year, id( VillageCode) failure(electricity ==1) origin(year==1961) 
stdes
stsum
xi:stcox   upper_vill  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_electricity)
outreg2 using  "./Tables/upper_cox.tex", keep(upper_vill  )  addtext( Controls, YES) ctitle("Electricity")  label append tex(frag)    nocons onecol  
xi:stcox   land_1929_single  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_electricity)
outreg2 using  "./Tables/single_cox.tex", keep(land_1929_single  )  addtext( Controls, YES)  ctitle("Electricity")  label append tex(frag)    nocons onecol 
xi:stcox   bah   
outreg2 using  "./Tables/bah_cox.tex", keep(bah  )  addtext( Controls, NO) ctitle("Electricity")  label append tex(frag)    nocons onecol 
xi:stcox   bah  logpop_1891   agra_dist subdistown_dist i.soil , tvc(Lags_electricity)
outreg2 using  "./Tables/bah_cox_cov.tex", keep(bah  )  addtext( Controls, YES) ctitle("Electricity")  label append tex(frag)   nocons onecol 


*****castes


 *brahmins (Table A21)
foreach var of varlist primaryschool {
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_1991.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991{
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_1991.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_1924.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_1924.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }


 


foreach var of varlist primaryschool {
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_2011.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   brahmin_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/brahmin_cov_2011.tex", keep(brahmin_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
 
*upper castes (table A14) 
foreach var of varlist primaryschool {
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991
outreg2 using  "./Tables/upper_cov_1991.tex", keep(upper_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991{
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991
outreg2 using  "./Tables/upper_cov_1991.tex", keep(upper_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924
outreg2 using  "./Tables/upper_cov_1924.tex", keep(upper_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924
outreg2 using  "./Tables/upper_cov_1924.tex", keep(upper_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 



 


foreach var of varlist primaryschool {
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011
outreg2 using  "./Tables/upper_cov_2011.tex", keep(upper_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011
outreg2 using  "./Tables/upper_cov_2011.tex", keep(upper_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
 *upper with land (Table A15)

foreach var of varlist primaryschool {
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_1991.tex", keep(upper_land  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991{
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_1991.tex", keep(upper_land  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_1924.tex", keep(upper_land  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_1924.tex", keep(upper_land  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }


 


foreach var of varlist primaryschool {
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_2011.tex", keep(upper_land  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   upper_land    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_land_cov_2011.tex", keep(upper_land  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
 *jats (Table A22)
 foreach var of varlist primaryschool {
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_1991.tex", keep(jat_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991{
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_1991.tex", keep(jat_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_1924.tex", keep(jat_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_1924.tex", keep(jat_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 


foreach var of varlist primaryschool {
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_2011.tex", keep(jat_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011 {
quietly acreg `var'   jat_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/jat_cov_2011.tex", keep(jat_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 *chamars (Table A23)
 foreach var of varlist primaryschool {
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_1991.tex", keep(chamar_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_1991.tex", keep(chamar_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_1924.tex", keep(chamar_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice  pg_indexA_1924{
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_1924.tex", keep(chamar_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }




 

foreach var of varlist primaryschool {
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_2011.tex", keep(chamar_vill  )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   chamar_vill    logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/chamar_cov_2011.tex", keep(chamar_vill  )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
  *alternate definitions of landlord tenure
  *legal definition (Table A11)
 gen pure_single=0
replace pure_single=1 if group1tenure=="single. Zamindari"|group1tenure=="single zamindari"|group1tenure=="single zamindare"|group1tenure=="single zamindare"|group1tenure=="single Zamindari"|group1tenure=="singe zamindari"|group1tenure=="singe zamindar"|group1tenure=="Single Zamindari"|group1tenure=="Single Zamindar"|group1tenure=="Zamindar"|group1tenure=="Zamindari"|group1tenure=="King"|group1tenure=="zamindar"|group1tenure=="zamindari"
replace pure_single=. if group1tenure==""|group1tenure=="na"|group1tenure=="ma"|group1tenure=="0"|group1tenure=="impute"|group1tenure=="NA"|group1tenure=="Na"|group1tenure=="n"
label var pure_single "Single Zamindar"
 foreach var of varlist primaryschool {
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_1991.tex", keep( pure_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991 {
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_1991.tex", keep( pure_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 
 foreach var of varlist primaryschool {
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_1924.tex", keep( pure_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_1924.tex", keep( pure_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }


foreach var of varlist primaryschool {
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_2011.tex", keep( pure_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'    pure_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/pure_single_2011.tex", keep( pure_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
 
   *only one owner (Table A12)
 gen single_single=0
replace single_single=1 if group1absentees +group1residents==1
replace single_single=. if group1absentees==.|group1residents==.
label var single_single "Single Zamindar"
 foreach var of varlist primaryschool {
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_1991.tex", keep( single_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991 {
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_1991.tex", keep( single_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 
 foreach var of varlist primaryschool {
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_1924.tex", keep( single_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_1924.tex", keep( single_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

foreach var of varlist primaryschool {
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_2011.tex", keep( single_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'    single_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_single_2011.tex", keep( single_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

    *95% cutoff (Table A13)
 gen single_90=0
replace single_90=1 if land_1929_single==1& prop_largest_land_caste>.95 &prop_largest_land_caste!=.
replace single_90=. if land_1929_single==.
label var single_90 "Single Zamindar"
 foreach var of varlist primaryschool {
quietly acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_1991.tex", keep( single_90 )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991 {
quietly acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_1991.tex", keep( single_90 )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 
 foreach var of varlist primaryschool {
 acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_1924.tex", keep( single_90 )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
 acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_1924.tex", keep( single_90 )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

foreach var of varlist primaryschool {
quietly acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_2011.tex", keep( single_90 )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'    single_90   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_90_2011.tex", keep( single_90 )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 *single (Table A5)
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_1991.tex", keep(land_1929_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_1991.tex", keep(land_1929_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_1924.tex", keep(land_1929_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_1924.tex", keep(land_1929_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_2011.tex", keep(land_1929_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_cov_2011.tex", keep(land_1929_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

****Interactions****
 *single ncov (Table A9)
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single    if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_1991.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly acreg `var'   land_1929_single absenteeprop absentee_single    if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_1991.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_1924.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   land_1929_single absenteeprop absentee_single    if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_1924.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }

 
 


foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_2011.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   land_1929_single absenteeprop absentee_single    if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_ncov_2011.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 
 *single cov  (Table A8)
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_1991.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_1991.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_1924.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_1924.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }

 
 


foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_2011.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   land_1929_single absenteeprop absentee_single   logpop_1891   agra_dist subdistown_dist i.soil  Lags_`var' i.subdistrictcode if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_interact_2011.tex", keep(land_1929_single absenteeprop absentee_single )  addtext( Controls, YES)  label append tex(frag)   nocons


 }
 
 *****panel  (Table A24)
 foreach var of varlist primaryschool {
 tsset VillageCode countyear_`var'
quietly reg `var'  lagged_`var'  previous_`var' cm_coethnic  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &cm_coethnic!=.
 outreg2 using "./Tables/cm_panel.tex", keep( cm_coethnic)  addtext(  Spatial Lags, YES, Time Lags, YES, Year FE, YES,  Village FE, YES)  label replace    nocons

		}


foreach var of varlist  postoffice middleschool highschool pucca electricity{
tsset VillageCode countyear_`var'
quietly reg `var'  lagged_`var'  previous_`var' cm_coethnic  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &cm_coethnic!=.
 outreg2 using "./Tables/cm_panel.tex", keep( cm_coethnic)  addtext(  Spatial Lags, YES, Time Lags, YES, Year FE, YES,  Village FE, YES)  label append tex(frag)    nocons

		}
		
				foreach var of varlist primaryschool {
				tsset VillageCode countyear_`var'
quietly reg `var'  lagged_`var'  previous_`var' cmparty mla_coethnic  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &cm_coethnic!=.
 outreg2 using "./Tables/mla_panel.tex", keep(cmparty  mla_coethnic )  addtext(  Spatial Lags, YES, Time Lags, YES, Year FE, YES,  Village FE, YES)  label replace    nocons

		}
		
		foreach var of varlist  postoffice middleschool highschool pucca electricity{
		tsset VillageCode countyear_`var'
quietly reg `var'  lagged_`var'  previous_`var' cmparty mla_coethnic  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &cm_coethnic!=.
 outreg2 using "./Tables/mla_panel.tex", keep(cmparty  mla_coethnic )  addtext(  Spatial Lags, YES, Time Lags, YES, Year FE, YES,  Village FE, YES)  label append tex(frag)    nocons

		}
		
	*cm panel abond	 (Table A25)
		preserve
		keep if countyear_primaryschool!=.
		foreach var of varlist primaryschool {
	
		tsset VillageCode countyear_`var'
   xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic cmparty i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label replace    nocons

			
 }
 restore
 
		preserve
		keep if countyear_postoffice!=.
		
 		foreach var of varlist  postoffice  {
		tsset VillageCode countyear_`var'
  quietly    xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic  cmparty  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label append tex(frag)    nocons

			
 }
  restore
  
  		preserve
		keep if countyear_highschool!=.
		
 		foreach var of varlist   highschool  {
		tsset VillageCode countyear_`var'
  quietly    xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic cmparty  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label append tex(frag)    nocons

			
 }
  restore
  
  
  		preserve
		keep if countyear_electricity!=.
		
 		foreach var of varlist   electricity{
		tsset VillageCode countyear_`var'
  quietly    xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic cmparty  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label append tex(frag)    nocons

			
 }
  restore
  
  
  		preserve
		keep if countyear_middleschool!=.
		
 		foreach var of varlist   middleschool   {
		tsset VillageCode countyear_`var'
  quietly    xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic cmparty  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label append tex(frag)    nocons

			
 }
  restore
  
    		preserve
		keep if countyear_pucca!=.
		
 		foreach var of varlist     pucca {
		tsset VillageCode countyear_`var'
  quietly    xtabond2 `var' lagged_`var'  previous_`var' mla_coethnic cmparty  i.countyear_`var'   i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil Lags_`var'  if year>1932 &mla_coethnic!=., gmm(l.`var'  previous_`var'  mla_coethnic Lags_`var') iv(i.countyear_`var'  i.subdistrictcode logpop_1891   agra_dist subdistown_dist i.soil) 
 outreg2 using "./Tables/cm_abond.tex", keep( mla_coethnic cmparty)  addtext( Controls, YES, Spatial Lags, YES, Year FE, YES, Subdistrict FE YES, DV Lags, YES)  label append tex(frag)    nocons

			
 }
  restore
  

 

 
 
 *matching models 
 *single landlord  (Table A6)

 foreach var of varlist primaryschool {
quietly reg `var'  land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==1991
outreg2 using  "./Tables/single_match_1991.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly reg `var'  land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==1991
outreg2 using  "./Tables/single_match_1991.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
 
  foreach var of varlist primaryschool {
quietly reg `var'  land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==1924
outreg2 using  "./Tables/single_match_1924.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice   pg_indexA_1924{
quietly reg `var'  land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==1924
outreg2 using  "./Tables/single_match_1924.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
 
  foreach var of varlist primaryschool {
quietly reg `var'  land_1929_single   logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==2011
outreg2 using  "./Tables/single_match_2011.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_2011{
quietly reg `var'   land_1929_single    logpop_1891   agra_dist subdistown_dist i.soil   i.singlegroup if year==2011
outreg2 using  "./Tables/single_match_2011.tex", keep(land_1929_single  )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
 *upper castes  (Table A16)
   foreach var of varlist primaryschool {
 reg `var'   upper_vill   logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==1991
outreg2 using  "./Tables/upper_match_1991.tex", keep(upper_vill )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
 reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==1991
outreg2 using  "./Tables/upper_match_1991.tex", keep(upper_vill )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
   foreach var of varlist primaryschool {
 reg `var'   upper_vill   logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==1924
outreg2 using  "./Tables/upper_match_1924.tex", keep(upper_vill )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice  pg_indexA_1924{
 reg `var'   upper_vill    logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==1924
outreg2 using  "./Tables/upper_match_1924.tex", keep(upper_vill )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
  foreach var of varlist primaryschool {
 reg `var'  upper_vill   logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==2011
outreg2 using  "./Tables/upper_match_2011.tex", keep(upper_vill  )  addtext( Controls, YES, Pair FE, YES)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_2011{
 reg `var'  upper_vill   logpop_1891   agra_dist subdistown_dist i.soil   i.uppergroup if year==2011
outreg2 using  "./Tables/upper_match_2011.tex", keep(upper_vill  )  addtext( Controls, YES, Pair FE, YES)  label append tex(frag)   nocons


 }
 
 
 ****NO COVS
 
 
 *upper castes   (Table A17)
foreach var of varlist primaryschool {
quietly acreg `var'   upper_vill     if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_1991.tex", keep(upper_vill  )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_1991{
quietly acreg `var'   upper_vill     if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_1991.tex", keep(upper_vill  )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   upper_vill     if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_1924.tex", keep(upper_vill  )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   upper_vill     if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_1924.tex", keep(upper_vill  )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 

 




 


foreach var of varlist primaryschool {
quietly acreg `var'   upper_vill     if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_2011.tex", keep(upper_vill  )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   upper_vill     if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/upper_ncov_2011.tex", keep(upper_vill  )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 
 
 *single landlord  (Table A7)
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single    if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_1991.tex", keep(land_1929_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity  pg_indexA_1991{
quietly acreg `var'   land_1929_single    if year==1991 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_1991.tex", keep(land_1929_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 

 
 foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single    if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_1924.tex", keep(land_1929_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice pg_indexA_1924 {
quietly acreg `var'   land_1929_single    if year==1924 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_1924.tex", keep(land_1929_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }



 


foreach var of varlist primaryschool {
quietly acreg `var'   land_1929_single    if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_2011.tex", keep(land_1929_single )  addtext( Controls, NO)  label replace   nocons


 }

foreach var of varlist  postoffice middleschool highschool pucca electricity pg_indexA_2011{
quietly acreg `var'   land_1929_single    if year==2011 , spatial  dist(10) latitude(latitude) longitude(longitude)
outreg2 using  "./Tables/single_ncov_2011.tex", keep(land_1929_single )  addtext( Controls, NO)  label append tex(frag)   nocons


 }
 
 
